Loading TOC...

MarkLogic Server 11.0 Product Documentation
POST /manage/v2/databases/{id|name}/temporal/collections

Summary

This resource address creates a new temporal collection for the named database.

URL Parameters
format The format of the posted data. Can be either html, json, or xml (default). This value overrides the Accept header if both are present.
Request Headers
Accept The expected MIME type of the response. If the format parameter is present, it takes precedence over the Accept header.
Response Headers
Content-type The MIME type of the data in the response body. Depending upon the value of the format parameter or Accept header, one of application/xml, application/json, or text/html.

Response

Upon success, MarkLogic Server returns status code 202 (Accepted). If the collection already exists or if the payload is malformed, a status code of 400 (Bad Request) is returned. A status code of 401 (Unauthorized) is returned if the user does not have the necessary privileges.

Required Privileges

This operation requires one of the following:

Usage Notes

The structure of the data in the request body is shown here.

Note: The properties described here are for XML payloads. In general they are the same for JSON, with the exception that, in JSON, options is expressed in singular form. For example, in JSON, options is instead option and the format is: "option":["opt"].

collection-id

The unique ID of the collection.

collection-name

The name of a temporal collection.

system-axis

System axis name for the temproal collection.

valid-axis

Valid axis name for the temporal collection.

options

Options for a temporal collection

This is a complex structure with the following children:

option

Option for temporal collection.

Example


   cat temporal-collection.json
   ==> 
   {
     "collection-name": "mycollectionnameuri",
     "system-axis": "mysystemaxisname",
     "valid-axis": "myvalidaxisname"
   }
 
  curl -X POST  --anyauth -u admin:admin --header "Content-Type:application/json" \
  -d @temporal-collection.json \
  http://localhost:8002/manage/v2/databases/Documents/temporal/collections

  ==>  Creates a temporal collection, named 'mycollectionnameuri," in the 
       Documents database. 
    

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.